package spring.my.suveng.aspect.xml;

import org.aspectj.lang.ProceedingJoinPoint;
import org.springframework.stereotype.Component;

/**
 * author: Veng Su
 * email: suveng@163.com
 * date: 2018/8/13 15:25
 */
@Component(value = "xmlAspect")
public class XmlAspect {
    //before 切
    public void beforeF(){
        System.out.println("我是before");
    }
    //after 切
    public void afterF(){
        System.out.println("我是after");
    }
    //after_throwing 切
    public void afterTF(){
        System.out.println("我是after-throwing");
    }
    //after-returning 切
    public void afterRF(){
        System.out.println("我是after-returning");
    }
    //around 切 要把joinpoint给传进来
    public void aroundF(ProceedingJoinPoint joinPoint){
        System.out.println("前around");
        try {
            joinPoint.proceed();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        System.out.println("后 around");

    }
}
